package cn.sc.summer.mybatis.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import cn.sc.summer.constant.enums.StatusEnum;
import cn.sc.summer.mybatis.annotation.table.TableFieldX;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * 类名：实体类公共信息集成对象-id与删除状态信息
 *
 * @author a-xin
 * @date 2023/8/13 21:29
 */
@Data
@Accessors(chain = true)
public abstract class BaseModel implements Serializable {

    private static final long serialVersionUID = -6867156232825350373L;

    /**
     * 数据id
     */
    @TableId(type = IdType.ASSIGN_ID)
    @TableFieldX(length = 32, comment = "数据ID", primary = true)
    private String id;

    /**
     * 是否删除，0：删除，1：未删除
     *
     * @see StatusEnum
     */
    @TableField(value = "del", fill = FieldFill.INSERT)
    @TableFieldX(comment = "是否删除，0：删除，1：未删除")
    private Integer del;

}
